<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;
return new class extends Migration {
    //人事档案
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('employee', function (Blueprint $table) {
            $table->charset = 'utf8mb4';
            $table->collation = 'utf8mb4_unicode_ci';
            $table->id();
            $table->string('employeeid', 30);
            $table->string('employeeid1', 30)->nullable();
            $table->string('name', 100)->nullable();
            $table->string('englishname', 100)->nullable();
            $table->string('idcard', 50)->nullable();
            $table->string('iccardnumber', 50)->nullable();
            $table->integer('isvirtualemp')->nullable()->default(0);
            $table->string('deptid', 50)->nullable();
            $table->string('position', 50)->nullable();
            $table->string('worktype', 50)->nullable();
            $table->decimal('salary', 28, 5)->nullable();
            $table->string('sex', 50)->nullable();
            $table->decimal('height', 28, 2)->nullable();
            $table->decimal('weight', 28, 2)->nullable();
            $table->string('tel', 50)->nullable();
            $table->string('education', 50)->nullable();
            $table->string('married', 50)->nullable();
            $table->datetime('birthday')->nullable();
            $table->string('addr', 500)->nullable();
            $table->string('nowplace', 500)->nullable();
            $table->string('email', 50)->nullable();
            $table->string('qq', 50)->nullable();
            $table->string('wechat', 50)->nullable();
            $table->string('registerplace', 100)->nullable();
            $table->datetime('registerdate')->nullable();
            $table->datetime('enterdate')->nullable();
            $table->datetime('confirmdate')->nullable();
            $table->datetime('leavedate')->nullable();
            $table->string('leavereason', 200)->nullable();
            $table->string('leavedes', 200)->nullable();
            $table->string('state', 50)->nullable();
            $table->binary('photo')->nullable();
            $table->string('emergenttel', 20)->nullable();
            $table->string('emergentadress', 50)->nullable();
            $table->string('emergentlinkname', 20)->nullable();
            $table->integer('isdel')->nullable()->default(0);
            $table->integer('synstate')->nullable();
            $table->timestamp('syndate')->nullable();
            $table->string('userid', 30)->nullable();
            $table->string('Native', 100)->nullable();
            $table->string('bank', 100)->nullable();
            $table->string('Polity', 100)->nullable();
            $table->string('talent', 500)->nullable();
            $table->string('school', 100)->nullable();
            $table->datetime('graduationtime')->nullable();
            $table->string('schoolarea', 200)->nullable();
            $table->string('emergencycontact', 100)->nullable();
            $table->string('zipcode', 100)->nullable();
            $table->string('emergencytel', 100)->nullable();
            $table->string('emergencyaddress', 200)->nullable();
            $table->string('birthplace', 200)->nullable();
            $table->string('residence', 200)->nullable();
            $table->string('mandes', 500)->nullable();
            $table->string('idcardnumber', 100)->nullable();
            $table->string('worknum', 100)->nullable();
            $table->string('efficiency', 100)->nullable();
            $table->string('residentunit', 200)->nullable();
            $table->integer('ishrchk')->nullable();
            $table->string('team', 100)->nullable();
            $table->string('skill', 200)->nullable();
            $table->integer('isnew')->nullable();
            $table->string('salarytype', 100)->nullable();
            $table->string('basesalary', 100)->nullable();
            $table->datetime('contractdatebe')->nullable();
            $table->datetime('contractdateend')->nullable();
            $table->datetime('comfirmdate')->nullable();
            $table->datetime('leafdate')->nullable();
            $table->string('leafreason', 100)->nullable();
            $table->string('leafdes', 200)->nullable();
            $table->string('documentplace', 200)->nullable();
            $table->integer('istraining')->nullable();
            $table->integer('isexam')->nullable();
            $table->string('examscores', 100)->nullable();
            $table->string('workdetail', 200)->nullable();
            $table->string('referrer', 100)->nullable();
            $table->string('referrertel', 100)->nullable();
            $table->string('referreraddress', 200)->nullable();
            $table->string('referrerunit', 200)->nullable();
            $table->string('guarantor', 100)->nullable();
            $table->string('guarantortel', 100)->nullable();
            $table->string('guarantoraddress', 200)->nullable();
            $table->string('guarantorunit', 200)->nullable();
            $table->integer('stopinsurance')->nullable();
            $table->string('insurancenum1', 100)->nullable();
            $table->string('insurancenum2', 100)->nullable();
            $table->string('insurancenum3', 100)->nullable();
            $table->string('allinsurance', 100)->nullable();
            $table->string('monthinsurance', 100)->nullable();
            $table->datetime('insuranceend')->nullable();
            $table->datetime('insurancebe')->nullable();
            $table->integer('isinsurance1')->nullable();
            $table->integer('isinsurance2')->nullable();
            $table->integer('isinsurance3')->nullable();
            $table->integer('isinsurance4')->nullable();
            $table->integer('isinsurance6')->nullable();
            $table->integer('isinsurance5')->nullable();
            $table->integer('isinsurance7')->nullable();
            $table->string('resume', 100)->nullable();
            $table->string('manrecord', 200)->nullable();
            $table->string('homedes', 200)->nullable();
            $table->string('contractdes', 200)->nullable();
            $table->string('guaranteedes', 200)->nullable();
            $table->timestamp('updated_at')->default(DB::raw('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'));
            $table->timestamp('created_at')->nullable();
            $table->string('browsepswd', 200)->nullable()->default('');
            $table->string('picturepath1', 100)->nullable();
            $table->string('picturepath2', 100)->nullable();
            $table->string('picturepath3', 100)->nullable();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('employee');
    }
};
